//
//Created by ESJsonFormatForMac on 20/05/13.
//

#import "GetMusic.h"

@implementation GetMusic

@end


@implementation GetMusicData

+ (NSDictionary *)objectClassInArray{
    return @{@"list" : [GetMusicList class]};
}
- (NSString *)base_url{
    if(_base_url == nil)
    {
        GetMusicList *aSong = self.list.firstObject;
        NSString *full_url = aSong.url;
        NSArray *comArr = [full_url componentsSeparatedByString:@"com"];
        if (comArr.count == 2) {
            _base_url = [comArr.firstObject stringByAppendingString:@"com"];
        }else{
            _base_url = @"";
        }
        
    }
    
    return _base_url;
}
@end



@implementation GetMusicPage_Info

@end



@implementation GetMusicList
- (NSString *)file_name{
    if(_file_name == nil)
    {
        NSString *full_url = self.url;
        NSArray *comArr = [full_url componentsSeparatedByString:@"com/"];
        if (comArr.count == 2) {
            _file_name = comArr.lastObject;
        }else{
            _file_name = @"";
        }
    }
    
    return _file_name;
}
@end


